package com.it.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.it.common.domain.dos.ArticleCategoryRelDO;

import java.util.List;

public interface ArticleCategoryRelMapper extends BaseMapper<ArticleCategoryRelDO> {

    int deleteByArticleId(Long articleId);

    ArticleCategoryRelDO selectByArticleId(Long articleId);

    /**
     * 根据分类 ID 查询
     * @param categoryId
     * @return {@link ArticleCategoryRelDO }
     */
    ArticleCategoryRelDO selectOneByCategoryId(Long categoryId);

    /**
     * 批量查询
     * @param articleIds
     * @return {@link List }<{@link ArticleCategoryRelDO }>
     */
    List<ArticleCategoryRelDO> selectByArticleIds(List<Long> articleIds);


    /**
     * 根据分类 ID 查询所有的关联记录
     * @param categoryId
     * @return {@link List }<{@link ArticleCategoryRelDO }>
     */
    List<ArticleCategoryRelDO> selectListByCategoryId(Long categoryId);


}
